const fs = require('fs');
let globalConf = {};

// console.log(fs.readFileSync('./server.conf').toString());
//port=8000 path=/web

// console.log(fs.readFileSync('./server.conf').toString().split('\r\n'));
//[ 'port=8000', 'path=/web' ]

let confs = fs.readFileSync('./server.conf').toString().split('\r\n');

confs.forEach((c) => {
  const item = c.split('=');
  const key = item[0];
  const value = item[1];
  globalConf[key] = value;
});

// console.log(globalConf);
// { port: '8000', path: '/web' }

module.exports = globalConf;
